import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/4/12
 * Time:15:52
 **/
public class Main {
    /**
     * 每日一题-返回所有组的最大分值和
     * 60%
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = 0;
        int[] array = new int[3*n];
        for(int i = 0; i<3*n;i++){
            array[i] = sc.nextInt();
        }
        Arrays.sort(array);
        for(int i = 1;i<=n;i++){
            num += array[2*i-1];
        }
        System.out.println(num);
    }
}
